<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header('修改配置信息')"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-gen-modify" name="form-gen-modify">
        <div class="form-group">
            <label class="col-sm-3 control-label">作者：</label>
            <div class="col-sm-8">
                <input id="author" name="author" class="form-control"
                       type="text" th:value="${property.author}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">邮箱：</label>
            <div class="col-sm-8">
                <input id="email" name="email" class="form-control" type="text"
                       th:value="${property.email}" readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">包名：</label>
            <div class="col-sm-8">
                <input id="package" name="package" class="form-control"
                       type="text" th:value="${property.package}" readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">模块名：</label>
            <div class="col-sm-8">
                <input id="module" name="module" class="form-control"
                       type="text" th:value="${property.module}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">自动去掉表前缀：</label>
            <div class="col-sm-8">
                <input id="autoRemovePre" name="autoRemovePre"
                       class="form-control i-checks" type="checkbox"
                       value="true" th:checked="${property.autoRemovePre}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">去掉指定表前缀：</label>
            <div class="col-sm-8">
                <input id="tablePrefix" name="tablePrefix" class="form-control" type="text"
                       th:value="${property.tablePrefix}">
            </div>
        </div>
    </form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
    var prefix = ctx + "tool/gen";
    $(".i-checks").iCheck({checkboxClass: "icheckbox_square-green-login"});
    $("#form-gen-modify").validate({
        rules: {
            author: {
                required: true
            },
            email: {
                required: true
            },
            package: {
                required: true
            },
            module: {
                required: true
            }
        }
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/modify", $('#form-gen-modify').serialize());
        }
    }
</script>
</body>
</html>
